import { createStore } from 'vuex'
import user from './modules/user'
import home from './modules/home'
import knowLedge from './modules/knowLedge'
import lanting from './modules/lanting'

import createPersistedstate from 'vuex-persistedstate'

// 创建vuex仓库并导出
export default createStore({
  modules: {
    // 分模块
    user, home, knowLedge, lanting
  },
  plugins: [
    // 默认是存储在localStorage中
    // key是存储数据的键名
    createPersistedstate({
      key: 'linting-client-pc-store-vux',
      paths: ['user', 'knowLedge', 'home', 'lanting']
    })
  ]
})
